import { formatTime } from '../../utils/util'

Page({
  data: {
    logs: []
  },
  onLoad() {
    const res = my.getStorageSync({ key: 'logs' })
    const logs = (res.data as any[]) || []

    this.setData({
      logs: logs.map((log: string) => {
        return {
          date: formatTime(new Date(log)),
          timeStamp: log
        }
      })
    })
  }
})
